<!-- 展示量表页面 -->
<template>
  <div>
    <div class="title" @click="goTest">
      <i>推荐测评</i>
      <el-icon><ArrowRightBold /></el-icon>
    </div>
    <div class="tableShow">
      <el-card
        class="card"
        shadow="hover"
        v-for="item in tableMessage"
        :key="item.id"
      >
        <div class="tag">
          <span>{{ item.tag }}</span>
        </div>
        <div class="content">
          <div>
            <div class="left">
              <img :src="item.img" />
            </div>
          </div>
          <div class="right">
            <div class="name">
              <div class="table-type">
                <div>{{ item.nameType }}</div>
              </div>
              <div class="table-abbr">
                <div>{{ item.nameAbbr }}</div>
              </div>
            </div>
            <div class="desc">
              <div>
                {{ item.desc }}
              </div>
            </div>
          </div>
        </div>
      </el-card>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from "vue-router";

defineProps(["tableMessage"]);
const $router = useRouter();
const goTest = () => {
  $router.push("/table");
};
</script>

<style scoped lang="scss">
/* stylelint-disable-next-line block-no-empty */
.title {
  display: flex;
  align-items: center;
  margin: 20px 0;
  margin-bottom: 5px;
  font-size: 16px;
  cursor:pointer;
  /* stylelint-disable-next-line rule-empty-line-before */
  i {
    font-weight: bold;
    color: black;
  }
  /* stylelint-disable-next-line block-no-empty */
  .el-icon {
    margin-top: 1px;
    margin-left: 2px;
    color: black;
  }
}
/* stylelint-disable-next-line rule-empty-line-before */
.tableShow {
  display: flex;
  flex-wrap: wrap;
  width: 800px;
  cursor:pointer;
  //grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  /* stylelint-disable-next-line rule-empty-line-before */
  .card {
    position: relative;
    width: 32%;
    margin: 5px;
    overflow: hidden;
    background-color: #fff;
    border-radius: 12px 14px;
    transition: 0.3s;
    /* stylelint-disable-next-line rule-empty-line-before */
    .tag {
      position: absolute;
      top: 0;
      right: 0;
      display: flex;
      flex-direction: row;
      width: 100%;
      /* stylelint-disable-next-line rule-empty-line-before */
      span {
        right: 0;
        z-index: 2;
        padding: 2px 8px;
        font-size: 12px;
        color: #f26101;
        background: radial-gradient(circle at 10% 20%, #fffcd6 0%, #fdece0 90%);
        border-bottom-left-radius: 6px;
      }
    }
    /* stylelint-disable-next-line rule-empty-line-before */
    .content {
      position: relative;
      display: flex;
      align-items: center;
      margin: -8px 0;
      /* stylelint-disable-next-line rule-empty-line-before */
      .left {
        width: 62px;
        height: 62px;
        //margin-right: 8px;
        overflow: hidden;
        border-radius: 6px;
        /* stylelint-disable-next-line rule-empty-line-before */
        img {
          position: absolute;
          top: 0;
          left: -12px;
          display: block;
          width: 62px;
          height: 62px;
        }
      }
      /* stylelint-disable-next-line rule-empty-line-before */
      .right {
        display: block;
        margin-left: -6px;
        /* stylelint-disable-next-line rule-empty-line-before */
        .name {
          display: flex;
          //flex-direction: row;
          align-items: center;
          margin-bottom: 2px;
          line-height: 16px;
          /* stylelint-disable-next-line rule-empty-line-before */
          .table-type {
            display: block;
            unicode-bidi: isolate;
            overflow: hidden;
            font-size: 15px;
            /* stylelint-disable-next-line color-hex-length */
            color: #333333;
            text-overflow: ellipsis;
            white-space: nowrap;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
          }
          /* stylelint-disable-next-line rule-empty-line-before */
          .table-abbr {
            display: block;
            unicode-bidi: isolate;
            padding: 2px;
            font-size: 12px;
            font-weight: 400;
            color: #6e6e73;
            white-space: nowrap;
            border: 1px solid #efefef;
            border-radius: 6px;
            transform: scale(0.8);
          }
        }
        /* stylelint-disable-next-line rule-empty-line-before */
        .desc {
          //display:block;
          display: -webkit-box;
          overflow: hidden;
          font-size: 12px;
          line-height: 16px;
          color: #6e6e73;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
        }
      }
    }
  }
  .card:active {
    transform: scale(0.98);
  }
}
</style>
